import sys

try: import xbmc
except: import xbmc_dummy as xbmc

try:
    __plugin__ = sys.modules["__main__"].__plugin__
except AttributeError:
    __plugin__ = 'python.debug.script'    
    
    
def debug( message, name=None ):
    xbmc.log( '%s.%s :: %s' % (__plugin__, name, message), xbmc.LOGDEBUG )    